﻿<navigation:Page x:Class="LEEAAttendanceControl.Views.Reports"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
           xmlns:my="clr-namespace:LEEAAttendanceControl.Web.Services"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="Reports">
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <LinearGradientBrush x:Key="BackRectangleBrush" EndPoint=".7,1" StartPoint=".7,0">
                <GradientStop Color="#FCFFFFFF" Offset="0.015"/>
                <GradientStop Color="#F7FFFFFF" Offset="0.375"/>
                <GradientStop Color="#E5FFFFFF" Offset="0.6"/>
                <GradientStop Color="#D1FFFFFF" Offset="1"/>
            </LinearGradientBrush>

            <Style x:Key="DataGridHeaderStyle" TargetType="sdk:DataGridColumnHeader">
                <Setter Property="HorizontalContentAlignment" Value="Center"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>

                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Grid x:Name="RootGrid">
                                <Rectangle Fill="#FF1F3B53" Stretch="Fill"/>

                                <Rectangle Stretch="Fill" Fill="{StaticResource BackRectangleBrush}" />

                                <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch" Width="1" HorizontalAlignment="Right"/>

                                <CheckBox x:Name="SelectAllCheckBox" Click="SelectAllCheckBox_Click" Margin="2,0,0,0"
                                          VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="380"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" Background="#404041">
            <TextBlock x:Name="ReportNameBlock" Text="Summary Time Card Report" Foreground="White" FontSize="14"
                       FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,3,3,2"/>
        </Grid>

        <StackPanel Grid.Row="1" Orientation="Vertical" Margin="0">
            <sdk:DataGrid x:Name="EmployeesGrid" VerticalScrollBarVisibility="Visible" AutoGenerateColumns="False"
                          MaxHeight="380">
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTemplateColumn Header="Name" CanUserReorder="False" CanUserResize="True"
                                                    Width="200" IsReadOnly="True">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                                    <TextBlock Text="{Binding FirstName}"/>
                                    <TextBlock Text=" "/>
                                    <TextBlock Text="{Binding LastName}"/>
                                </StackPanel>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                    <sdk:DataGridTemplateColumn Header="Department" CanUserReorder="False" CanUserResize="True"
                                                    Width="175" IsReadOnly="True">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <sdk:Label Content="{Binding Department}" HorizontalAlignment="Left" Margin="5,0,0,0"
                                               VerticalAlignment="Center"/>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                    <sdk:DataGridTemplateColumn Width="100" HeaderStyle="{StaticResource DataGridHeaderStyle}"
                                                    CanUserReorder="False" CanUserResize="False">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox x:Name="EmployeeCheck" HorizontalAlignment="Center" VerticalAlignment="Center"
                                              Click="EmployeeCheck_Click" IsChecked="{Binding IsChecked, Mode=TwoWay}"/>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                </sdk:DataGrid.Columns>
            </sdk:DataGrid>
        </StackPanel>

        <Grid Grid.Row="2">
            <Rectangle Fill="#404041" Margin="0,10,0,5" Height="2"/>
        </Grid>

        <Grid Grid.Row="3" Margin="0,5,0,5" HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="65"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="50"/>
                <ColumnDefinition Width="65"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <sdk:Label Content="Report Duration" Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="0" FontSize="14"
                       FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10,0,20"/>

            <sdk:Label Content="From:" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left"
                       VerticalAlignment="Center" Margin="3"/>

            <sdk:DatePicker x:Name="FromPicker" Grid.Column="1" Width="165" Margin="3" Grid.Row="1"/>

            <sdk:Label Content="To" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left"
                       VerticalAlignment="Center" Margin="3"/>

            <sdk:DatePicker x:Name="ToPicker" Grid.Column="4" Grid.Row="1" Width="165" Margin="3"/>
        </Grid>

        <Button x:Name="GenerateButton" Content="Generate Report" Grid.Row="4" Height="25" Width="120"
                HorizontalAlignment="Center" Margin="0,30,0,10" Click="GenerateButton_Click"/>
    </Grid>
</navigation:Page>
